package chpt03;

public class PersonV3Demo {
	public static void main(String[] args) {
		//new PersonV3()报错：The constructor PersonV3() is undefined
		//PersonV3 p1 = new PersonV3();
		PersonV3 p1 = new PersonV3(1, "Tom"); //只能在new时调用构造方法
		PersonV3 p2 = new PersonV3(2, "Jerry", "133***");
		PersonV3 p3 = new PersonV3("Java", "188***", 2010, 6, 1);
		System.out.println(p1.toString());
		System.out.println(p2); // 实际上调用了p2.toString()方法
		System.out.println(p3);
		
	}
}
